package stream;

public class Filter {

    public static void main(String[] args) {
        // 需求：筛选出年龄大于20的学生对象
        Student.getStudents().stream().filter(student -> student.getAge() > 18).forEach(System.out::println);
        System.out.println("============================");
        // 需求：筛选出字符串长度大于3的元素
        Student.getStudents().stream().filter(student -> student.getName().length() > 3).forEach(System.out::println);
    }
}
